using UnityEngine;
using System.Collections;

[System.Serializable]
public class Event3 : MonoBehaviour {
	
	public float percentChanceToTrigger = 26.0f;
	public GameObject toBeDestroyedWhenNotTriggered;
	
	// Use this for initialization
	void Start () {
		while (Game.game.random == null) { /* Wait until the game script has been initated */ }
		
		bool triggered = (Game.game.random.Next(1, ((int)(100f/percentChanceToTrigger))) == 1);
		
		if (!triggered) {
			GameObject.Destroy(toBeDestroyedWhenNotTriggered);
		} else {
			Debug.Log("Event 3 triggered");
		}
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
